//////////////////////////////////////////////////////////////////////////
#pragma once


//////////////////////////////////////////////////////////////////////////
#include "Math/Math.hpp"
#include "Math/Vector3f.hpp"
#include "Math/Vector4f.hpp"


namespace Math
{
	class Quaternionf;
	
	class Matrix44f
	{
	public:
		// Construction.
		Matrix44f();
		Matrix44f( const Matrix44f& rhs );
		Matrix44f(
			float	m11,	float	m21,	float	m31,	float	m41,
			float	m12,	float	m22,	float	m32,	float	m42,
			float	m13,	float	m23,	float	m33,	float	m43,
			float	m14,	float	m24,	float	m34,	float	m44
			);
		Matrix44f(
			const Vector4f&	column1,
			const Vector4f&	column2,
			const Vector4f&	column3,
			const Vector4f&	column4
			);

		// Array access.  Indexed into rows.
		Vector4f&					operator()( size_t column );
		const Vector4f&				operator()( size_t column ) const;
		void						operator()( size_t column, const Vector4f& v );
		
		// Assignment.
		const Matrix44f&			operator =( const Matrix44f& rhs );

		//
		const Matrix44f				operator *( const Matrix44f& rhs ) const;
		const Vector4f				operator *( const Vector4f& rhs ) const;
		void						operator *=( float rhs );

		//
		void						Transpose();
		void						Inverse();

		// Static initializers.
		static Matrix44f			Zero();
		static Matrix44f			Identity();
		static Matrix44f			Translation( float x, float y, float z );
		static Matrix44f			Translation( const Vector3f& t );
		static Matrix44f			Scale( float x, float y, float z );
		static Matrix44f			Scale( const Vector3f& t );
		static Matrix44f			RotateX( float angle );
		static Matrix44f			RotateY( float angle );
		static Matrix44f			RotateZ( float angle );
		static Matrix44f			Rotate( const Vector3f& axis, float angle );
		static Matrix44f			From( const Quaternionf& q );

	private:
		// Implementation data.
		Vector4f					mColumns[ 4 ];
	};


	//////////////////////////////////////////////////////////////////////////
	inline const Vector3f		operator *( const Math::Matrix44f& lhs, const Vector3f& rhs );
}


// Include the implementations.
#include "Detail/Matrix44f_Impl.hpp"
